<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>
	<head>
		<base href="<%=basePath%>">
		<title>时间段规则</title>
		<%@include file="../collect/meta.jsp"%>
		<link rel="stylesheet" href="css/radius.css" type="text/css"></link>
		<script type="text/javascript" src="${ctx}/js/returnTop.js"></script>
	</head>
	<body lang="zh-cn">
		<div class="wrapper">
			<c:import url="/collect/top.jsp"></c:import>
			<div class="main-container" id="main-container">
				<div class="main-container-inner">
					<c:import url="/collect/left.jsp"></c:import>
					<div class="main-content">
						<div class="breadcrumbs" id="breadcrumbs">
							<ul class="breadcrumb">
								<li><i class="icon-home home-icon"></i>积分管理</li>
								<li><a href="integralrule!watchEnterpriseIntegralRule">积分规则</a></li>
								<li>时间段规则</li>
							</ul>
						</div>
						<div class="page-content">
							<div class="row">
								<div class="col-xs-12">
									<div class="tabbable">
										<ul class="nav nav-tabs" id="myTab">
											<li><a href="integralrule!watchEnterpriseIntegralRule">积分等级</a></li>
											<li><a href="bGiveRule!entrygiveValue">注册时积分规则</a></li>
											<li class="active"><a href="bGiveRule!watchBgiveRule">时间段规则</a></li>
										</ul>
									</div>
									<br>
									<div class="alert alert-success">
										设置在某个时间段内会员消费时获得积分的规则，支持额外增加积分和积分翻倍。系统的积分规则为1元=1积分。
										若选择额外增加积分，假设额外增加积分为100积分，而会员消费为100元，则会员获得积分数为200分(100+100=200)。
										若选择积分翻倍，假设翻倍倍数为1.5，而会员消费为100元，则会员获得积分数为150分(100*1.5=150)。
									</div>
									<table id="table_bug_report" class="table table-striped table-bordered table-hover">
										<tr>
											<th colspan="7"><a class="btn btn-primary radius" href="${ctx}/account/b_give_rule_add.jsp">新建</a></th>
										</tr>
										<tr>
											<td height="25"><div align="center">活动名称</div></td>
											<td height="25"><div align="center">创建时间</div></td>
											<td><div align="center">开始时间</div></td>
											<td><div align="center">结束时间</div></td>
											<td><div align="center">积分操作</div></td>
											<td><div align="center">状态</div></td>
											<td width="25%"><div align="center">操作</div></td>
										</tr>
										<c:forEach items="${bGiveRules}" var="bGiveRule" varStatus="status">
											<tr>
												<td height="25"><div align="center">${bGiveRule.name }</div></td>
												<td height="25"><div align="center">${bGiveRule.createTime }</div></td>
												<td><div align="center">${bGiveRule.fromTime }</div></td>
												<td><div align="center">${bGiveRule.toTime }</div></td>
												<td style="display: none;">${bGiveRule.id}</td>
												<td>
													<c:if test="${bGiveRule.type==2 }">
														<div align="center">积分翻倍${bGiveRule.raiseValue}</div>
													</c:if>
													<c:if  test="${bGiveRule.type==3 }">
														<div align="center">积分增加${bGiveRule.raiseValue}</div>
													</c:if>
												</td>
												<td>
													<c:if test="${bGiveRule.state==1 }">
														<div align="center">开启</div>
													</c:if>
													<c:if test="${bGiveRule.state==2 }">
														<div align="center">暂停</div>
													</c:if>
												</td>
												<td>
													<div align="center">
														<a class="btn btn-xs btn-primary radius" href="bGiveRule!getOneBgiveRule?id=${bGiveRule.id}">修改</a>
														<a class="btn btn-xs btn-primary radius" href="bGiveRule!delBgiveRule?id=${bGiveRule.id}" onclick="javascript:return confirm('确定要删除吗？');">删除</a>
													</div>
												</td>
											</tr>
										</c:forEach>
									</table>
								</div>
							</div>
						</div>
					</div>
				</div>
				<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse" style="position: fixed; bottom: 0;">
					<i class="icon-double-angle-up icon-only bigger-110"></i>
				</a>
			</div>
			<div class="push"></div>
		</div>
		<c:import url="/collect/down.jsp"></c:import>
		<script type="text/javascript">
			$('.jifenguanli > ul').show();
			$('.jifenguanli > ul > li > a').eq(0).css("color","red"); 
		</script>
	</body>
</html>
